<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<div class="pageContent">
    <form method="post"  onsubmit="return iframeCallback(this, navTabAjaxDone);" action="article/update/${article.articleId}" class="pageForm required-validate" enctype="multipart/form-data">
        <div class="pageFormContent" layoutH="56">
            <p>
                <label>标题：</label>
                <input name="articleTitle" class="required" type="text" size="30" value="${article.articleTitle}"/>
            </p>
            <p>
                <label>文章类型：</label>
                <input type="hidden" id="hah" name="fourType.typeId" value="${article.fourType.typeId}">
                <input type="hidden" id="contenthah" name="fourContent.contentId" value="${article.fourContent.contentId}">
                <select id="type" name="fourType.typeId" onchange="haha();">
                    <option value="0"  >请选择:</option>
                    <option value="1" >家居风水</option>
                    <option value="2" >装修日记</option>
                    <option value="3" >巧装美家</option>
                    <option value="4" >乐购攻略</option>
                    <option value="5" >行业新闻</option>
                </select>
                <script>
                    $(function () {
                        for(var i=0;i<=5;i++){
                            if($("#hah").val() == i){
                                $("#type").val(i);
                            }
                        }
                    })

                    function haha(){
                        if ($("#type  option:selected").val()==1) {
                            $("#articleHead").attr("value","【美乐乐家居风水知识】阳宅风水大师坐镇-最新家居风水布局-各类卧室风水禁忌")
                            return;
                        } else if($("#type  option:selected").val()==2) {
                            $("#articleHead").attr("value","【装修日记】最新装修日记资讯-装修日记效果图片分享-美乐乐装修日记频道")
                            return;
                        }else if($("#type  option:selected").val()==3) {
                            $("#articleHead").attr("value","【巧装美家】室内装修方法,室内装饰步骤-美乐乐巧装美家频道")
                            return;
                        }else if($("#type  option:selected").val()==4) {
                            $("#articleHead").attr("value","【乐购攻略】家居商品购买技巧,最实惠价格尽在—美乐乐乐购攻略频道")
                            return;
                        }else if($("#type  option:selected").val()==5) {
                            $("#articleHead").attr("value","【行业新闻】家居新闻资讯动态中心-美乐乐行业新闻频道")
                            return;
                        }else{
                            alert("请选择一个类型")
                            return;
                        }
                    }
                </script>
            </p>
            <p>
                <label>head：</label>
                <input type="text" readonly="readonly" id="articleHead" name="articleHead" value="${article.articleHead}">

            </p>
            <p>
                <label>文章小标题：</label>
                <input type="text"  name="articleSmallTitle" class="textInput" value="${article.articleSmallTitle}">
            </p>
            <p >
                <label>上传图片：</label>
                <input name="photo" class="required" type="file" size="30"/>
            </p>
            <p>
                <label>原始图片：</label>
                <img src="image/index/${article.articleImage}" style="height: 80px;"></p>
            <p></p>
            <p></p>
            <p></p>
            <p>
                <label>上传文章内容：</label><br/><br/>
                <textarea  class="ckeditor"  name="fourContent.content">${article.fourContent.content}</textarea>
            </p>

            <script type="text/javascript">
                CKEDITOR.replace('fourContent.content');
            </script>

        </div>
        <div class="formBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent"><button type="submit">确认修改</button></div></div></li>
                <li>
                    <div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
                </li>
            </ul>
        </div>
    </form>
</div>
